package cn.stylefeng.guns.modular.gridsystem.timer;

import cn.stylefeng.guns.core.timer.TimerTaskRunner;
import cn.stylefeng.guns.modular.gridsystem.entity.BizGateway;
import cn.stylefeng.guns.modular.gridsystem.service.BizGatewayService;
import cn.stylefeng.guns.modular.gridsystem.service.BizGatewayTemperatureService;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 网关上报数据定时任务管理
 */
@Component
public class GatewayReportTaskRunner implements TimerTaskRunner {

    @Resource
    private BizGatewayService bizGatewayService;

    @Override
    public void action() {
        LambdaUpdateWrapper<BizGateway> wrapper = new LambdaUpdateWrapper<>();
        wrapper.set(BizGateway::getDataReportingSwitch, 0);
        bizGatewayService.update(wrapper);
    }

}
